var obj = {
  name: "kaki",
  age: 19,
};

Object.keys(obj).forEach(item => {
  Object.defineProperty(obj, item, {
    set: function (newValue) {
      console.log(`监听到${item}的change`);
      console.log(newValue);
      value = newValue;
    },
    get: function (newValue) {
      console.log(`监听到${item}的读取`);
      return value;
    },
  });
});

obj.name = "mamhah";

console.log(obj.name);
